package com.xieyong.mywebsite.model.entity;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Category extends BaseEntity {
    @NotNull(groups = {Update.class})
    private Integer id;
    @NotEmpty
    private String categoryName;
    @NotEmpty
    private String categoryAlias;

//    不存储数据字段
    private String nickName;

//    如果某个校验项没有指定分组，则默认属于Default分组
//    分组之间可以继承

    public interface Add extends Default {}
    public interface Update extends Default {}
}
